<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Box2D APi: C:/Users/ARme/Desktop/box2d/Box2D/Dynamics/Contacts/b2Contact.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Box2D APi
   &#160;<span id="projectnumber">251</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('b2_contact_8h.html','');
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">C:/Users/ARme/Desktop/box2d/Box2D/Dynamics/Contacts/b2Contact.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment">* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org</span>
<a name="l00003"></a>00003 <span class="comment">*</span>
<a name="l00004"></a>00004 <span class="comment">* This software is provided &#39;as-is&#39;, without any express or implied</span>
<a name="l00005"></a>00005 <span class="comment">* warranty.  In no event will the authors be held liable for any damages</span>
<a name="l00006"></a>00006 <span class="comment">* arising from the use of this software.</span>
<a name="l00007"></a>00007 <span class="comment">* Permission is granted to anyone to use this software for any purpose,</span>
<a name="l00008"></a>00008 <span class="comment">* including commercial applications, and to alter it and redistribute it</span>
<a name="l00009"></a>00009 <span class="comment">* freely, subject to the following restrictions:</span>
<a name="l00010"></a>00010 <span class="comment">* 1. The origin of this software must not be misrepresented; you must not</span>
<a name="l00011"></a>00011 <span class="comment">* claim that you wrote the original software. If you use this software</span>
<a name="l00012"></a>00012 <span class="comment">* in a product, an acknowledgment in the product documentation would be</span>
<a name="l00013"></a>00013 <span class="comment">* appreciated but is not required.</span>
<a name="l00014"></a>00014 <span class="comment">* 2. Altered source versions must be plainly marked as such, and must not be</span>
<a name="l00015"></a>00015 <span class="comment">* misrepresented as being the original software.</span>
<a name="l00016"></a>00016 <span class="comment">* 3. This notice may not be removed or altered from any source distribution.</span>
<a name="l00017"></a>00017 <span class="comment">*/</span>
<a name="l00018"></a>00018 
<a name="l00019"></a>00019 <span class="preprocessor">#ifndef B2_CONTACT_H</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define B2_CONTACT_H</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;Box2D/Common/b2Math.h&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;<a class="code" href="b2_collision_8h.html">Box2D/Collision/b2Collision.h</a>&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;Box2D/Collision/Shapes/b2Shape.h&gt;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;Box2D/Dynamics/b2Fixture.h&gt;</span>
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 <span class="keyword">class </span><a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>;
<a name="l00028"></a>00028 <span class="keyword">class </span><a class="code" href="classb2_contact.html">b2Contact</a>;
<a name="l00029"></a>00029 <span class="keyword">class </span><a class="code" href="classb2_fixture.html">b2Fixture</a>;
<a name="l00030"></a>00030 <span class="keyword">class </span><a class="code" href="classb2_world.html">b2World</a>;
<a name="l00031"></a>00031 <span class="keyword">class </span><a class="code" href="classb2_block_allocator.html">b2BlockAllocator</a>;
<a name="l00032"></a>00032 <span class="keyword">class </span><a class="code" href="classb2_stack_allocator.html">b2StackAllocator</a>;
<a name="l00033"></a>00033 <span class="keyword">class </span><a class="code" href="classb2_contact_listener.html">b2ContactListener</a>;
<a name="l00034"></a>00034 
<a name="l00037"></a>00037 <span class="keyword">inline</span> float32 b2MixFriction(float32 friction1, float32 friction2)
<a name="l00038"></a>00038 {
<a name="l00039"></a>00039         <span class="keywordflow">return</span> std::sqrt(friction1 * friction2);
<a name="l00040"></a>00040 }
<a name="l00041"></a>00041 
<a name="l00044"></a>00044 <span class="keyword">inline</span> float32 b2MixRestitution(float32 restitution1, float32 restitution2)
<a name="l00045"></a>00045 {
<a name="l00046"></a>00046         <span class="keywordflow">return</span> restitution1 &gt; restitution2 ? restitution1 : restitution2;
<a name="l00047"></a>00047 }
<a name="l00048"></a>00048 
<a name="l00049"></a>00049 <span class="keyword">typedef</span> <a class="code" href="classb2_contact.html">b2Contact</a>* b2ContactCreateFcn(  <a class="code" href="classb2_fixture.html">b2Fixture</a>* fixtureA, int32 indexA,
<a name="l00050"></a>00050                                                                                 <a class="code" href="classb2_fixture.html">b2Fixture</a>* fixtureB, int32 indexB,
<a name="l00051"></a>00051                                                                                 <a class="code" href="classb2_block_allocator.html">b2BlockAllocator</a>* allocator);
<a name="l00052"></a>00052 <span class="keyword">typedef</span> <span class="keywordtype">void</span> b2ContactDestroyFcn(<a class="code" href="classb2_contact.html">b2Contact</a>* contact, <a class="code" href="classb2_block_allocator.html">b2BlockAllocator</a>* allocator);
<a name="l00053"></a>00053 
<a name="l00054"></a><a class="code" href="structb2_contact_register.html">00054</a> <span class="keyword">struct </span><a class="code" href="structb2_contact_register.html">b2ContactRegister</a>
<a name="l00055"></a>00055 {
<a name="l00056"></a>00056         b2ContactCreateFcn* createFcn;
<a name="l00057"></a>00057         b2ContactDestroyFcn* destroyFcn;
<a name="l00058"></a>00058         <span class="keywordtype">bool</span> primary;
<a name="l00059"></a>00059 };
<a name="l00060"></a>00060 
<a name="l00066"></a><a class="code" href="structb2_contact_edge.html">00066</a> <span class="keyword">struct </span><a class="code" href="structb2_contact_edge.html">b2ContactEdge</a>
<a name="l00067"></a>00067 {
<a name="l00068"></a><a class="code" href="structb2_contact_edge.html#a69015fc22e064eac04ed74f27a13ae78">00068</a>         <a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>* <a class="code" href="structb2_contact_edge.html#a69015fc22e064eac04ed74f27a13ae78" title="provides quick access to the other body attached.">other</a>;                  
<a name="l00069"></a><a class="code" href="structb2_contact_edge.html#a2fbfaffa0dfdf715fd1a709cff939dee">00069</a>         <a class="code" href="classb2_contact.html">b2Contact</a>* <a class="code" href="structb2_contact_edge.html#a2fbfaffa0dfdf715fd1a709cff939dee" title="the contact">contact</a>;             
<a name="l00070"></a><a class="code" href="structb2_contact_edge.html#a606dfacb78dc5c51672e4d7449006b8c">00070</a>         <a class="code" href="structb2_contact_edge.html">b2ContactEdge</a>* <a class="code" href="structb2_contact_edge.html#a606dfacb78dc5c51672e4d7449006b8c" title="the previous contact edge in the body&#39;s contact list">prev</a>;    
<a name="l00071"></a><a class="code" href="structb2_contact_edge.html#a9af32b3cfadf35a927f4dffcf6338a6d">00071</a>         <a class="code" href="structb2_contact_edge.html">b2ContactEdge</a>* <a class="code" href="structb2_contact_edge.html#a9af32b3cfadf35a927f4dffcf6338a6d" title="the next contact edge in the body&#39;s contact list">next</a>;    
<a name="l00072"></a>00072 };
<a name="l00073"></a>00073 
<a name="l00077"></a><a class="code" href="classb2_contact.html">00077</a> <span class="keyword">class </span><a class="code" href="classb2_contact.html">b2Contact</a>
<a name="l00078"></a>00078 {
<a name="l00079"></a>00079 <span class="keyword">public</span>:
<a name="l00080"></a>00080 
<a name="l00083"></a>00083         <a class="code" href="structb2_manifold.html">b2Manifold</a>* <a class="code" href="classb2_contact.html#ab0597077b23615476327f9b32d9c4979">GetManifold</a>();
<a name="l00084"></a>00084         <span class="keyword">const</span> <a class="code" href="structb2_manifold.html">b2Manifold</a>* <a class="code" href="classb2_contact.html#ab0597077b23615476327f9b32d9c4979">GetManifold</a>() <span class="keyword">const</span>;
<a name="l00085"></a>00085 
<a name="l00087"></a>00087         <span class="keywordtype">void</span> <a class="code" href="classb2_contact.html#a6a30a44a28b44754cb61bba65cb5b728" title="Get the world manifold.">GetWorldManifold</a>(<a class="code" href="structb2_world_manifold.html" title="This is used to compute the current state of a contact manifold.">b2WorldManifold</a>* worldManifold) <span class="keyword">const</span>;
<a name="l00088"></a>00088 
<a name="l00090"></a>00090         <span class="keywordtype">bool</span> <a class="code" href="classb2_contact.html#a367dc9a563ad7db5547f4247777a33c9" title="Is this contact touching?">IsTouching</a>() <span class="keyword">const</span>;
<a name="l00091"></a>00091 
<a name="l00095"></a>00095         <span class="keywordtype">void</span> <a class="code" href="classb2_contact.html#a6edf582f8c161d6632854cddefe55a0c">SetEnabled</a>(<span class="keywordtype">bool</span> flag);
<a name="l00096"></a>00096 
<a name="l00098"></a>00098         <span class="keywordtype">bool</span> <a class="code" href="classb2_contact.html#ae7bd71ee1b0bb352bec6eeaab4f91c6a" title="Has this contact been disabled?">IsEnabled</a>() <span class="keyword">const</span>;
<a name="l00099"></a>00099 
<a name="l00101"></a>00101         <a class="code" href="classb2_contact.html">b2Contact</a>* <a class="code" href="classb2_contact.html#aebfebb1e4b27dc0bd7aa120093e3d650" title="Get the next contact in the world&#39;s contact list.">GetNext</a>();
<a name="l00102"></a>00102         <span class="keyword">const</span> <a class="code" href="classb2_contact.html">b2Contact</a>* <a class="code" href="classb2_contact.html#aebfebb1e4b27dc0bd7aa120093e3d650" title="Get the next contact in the world&#39;s contact list.">GetNext</a>() <span class="keyword">const</span>;
<a name="l00103"></a>00103 
<a name="l00105"></a>00105         <a class="code" href="classb2_fixture.html">b2Fixture</a>* <a class="code" href="classb2_contact.html#a707a3a5a14c2cdd4c6eb7fc648d76037" title="Get fixture A in this contact.">GetFixtureA</a>();
<a name="l00106"></a>00106         <span class="keyword">const</span> <a class="code" href="classb2_fixture.html">b2Fixture</a>* <a class="code" href="classb2_contact.html#a707a3a5a14c2cdd4c6eb7fc648d76037" title="Get fixture A in this contact.">GetFixtureA</a>() <span class="keyword">const</span>;
<a name="l00107"></a>00107 
<a name="l00109"></a>00109         int32 <a class="code" href="classb2_contact.html#ab0c9c059c776f315ae62abb5c978afcc" title="Get the child primitive index for fixture A.">GetChildIndexA</a>() <span class="keyword">const</span>;
<a name="l00110"></a>00110 
<a name="l00112"></a>00112         <a class="code" href="classb2_fixture.html">b2Fixture</a>* <a class="code" href="classb2_contact.html#a68464fe587d7e6a1f52763e965bb7361" title="Get fixture B in this contact.">GetFixtureB</a>();
<a name="l00113"></a>00113         <span class="keyword">const</span> <a class="code" href="classb2_fixture.html">b2Fixture</a>* <a class="code" href="classb2_contact.html#a68464fe587d7e6a1f52763e965bb7361" title="Get fixture B in this contact.">GetFixtureB</a>() <span class="keyword">const</span>;
<a name="l00114"></a>00114 
<a name="l00116"></a>00116         int32 <a class="code" href="classb2_contact.html#a9edc26022c3d1a9cf1dab9d79d639b3f" title="Get the child primitive index for fixture B.">GetChildIndexB</a>() <span class="keyword">const</span>;
<a name="l00117"></a>00117 
<a name="l00120"></a>00120         <span class="keywordtype">void</span> <a class="code" href="classb2_contact.html#a5e8fbb6bb2966ac84272bb0ea9d2e4c7">SetFriction</a>(float32 friction);
<a name="l00121"></a>00121 
<a name="l00123"></a>00123         float32 <a class="code" href="classb2_contact.html#a0b6daf4137fd1719961f5d780b8dda15" title="Get the friction.">GetFriction</a>() <span class="keyword">const</span>;
<a name="l00124"></a>00124 
<a name="l00126"></a>00126         <span class="keywordtype">void</span> <a class="code" href="classb2_contact.html#ad66d9290da187cef4c9f48c5766d4460" title="Reset the friction mixture to the default value.">ResetFriction</a>();
<a name="l00127"></a>00127 
<a name="l00130"></a>00130         <span class="keywordtype">void</span> <a class="code" href="classb2_contact.html#a24ca342c2bb766c53ef5ad04f5268fc1">SetRestitution</a>(float32 restitution);
<a name="l00131"></a>00131 
<a name="l00133"></a>00133         float32 <a class="code" href="classb2_contact.html#aed12746a2855277479802144b699326b" title="Get the restitution.">GetRestitution</a>() <span class="keyword">const</span>;
<a name="l00134"></a>00134 
<a name="l00136"></a>00136         <span class="keywordtype">void</span> <a class="code" href="classb2_contact.html#a243501bc5c146e9eb1296162d328aef1" title="Reset the restitution to the default value.">ResetRestitution</a>();
<a name="l00137"></a>00137 
<a name="l00139"></a>00139         <span class="keywordtype">void</span> <a class="code" href="classb2_contact.html#a32033914a6c7f35b469e8fddbc17c566" title="Set the desired tangent speed for a conveyor belt behavior. In meters per second.">SetTangentSpeed</a>(float32 speed);
<a name="l00140"></a>00140 
<a name="l00142"></a>00142         float32 <a class="code" href="classb2_contact.html#a961417ed0d43706ee8a39c396d5e6002" title="Get the desired tangent speed. In meters per second.">GetTangentSpeed</a>() <span class="keyword">const</span>;
<a name="l00143"></a>00143 
<a name="l00145"></a>00145         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classb2_contact.html#ae3c2842e5325b2d4500f8ed1d4de2f72" title="Evaluate this contact with your own manifold and transforms.">Evaluate</a>(<a class="code" href="structb2_manifold.html">b2Manifold</a>* manifold, <span class="keyword">const</span> <a class="code" href="structb2_transform.html">b2Transform</a>&amp; xfA, <span class="keyword">const</span> <a class="code" href="structb2_transform.html">b2Transform</a>&amp; xfB) = 0;
<a name="l00146"></a>00146 
<a name="l00147"></a>00147 <span class="keyword">protected</span>:
<a name="l00148"></a>00148         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_contact_manager.html">b2ContactManager</a>;
<a name="l00149"></a>00149         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_world.html">b2World</a>;
<a name="l00150"></a>00150         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_contact_solver.html">b2ContactSolver</a>;
<a name="l00151"></a>00151         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>;
<a name="l00152"></a>00152         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classb2_fixture.html">b2Fixture</a>;
<a name="l00153"></a>00153 
<a name="l00154"></a>00154         <span class="comment">// Flags stored in m_flags</span>
<a name="l00155"></a>00155         <span class="keyword">enum</span>
<a name="l00156"></a>00156         {
<a name="l00157"></a>00157                 <span class="comment">// Used when crawling contact graph when forming islands.</span>
<a name="l00158"></a>00158                 e_islandFlag            = 0x0001,
<a name="l00159"></a>00159 
<a name="l00160"></a>00160         <span class="comment">// Set when the shapes are touching.</span>
<a name="l00161"></a>00161                 e_touchingFlag          = 0x0002,
<a name="l00162"></a>00162 
<a name="l00163"></a>00163                 <span class="comment">// This contact can be disabled (by user)</span>
<a name="l00164"></a>00164                 e_enabledFlag           = 0x0004,
<a name="l00165"></a>00165 
<a name="l00166"></a>00166                 <span class="comment">// This contact needs filtering because a fixture filter was changed.</span>
<a name="l00167"></a>00167                 e_filterFlag            = 0x0008,
<a name="l00168"></a>00168 
<a name="l00169"></a>00169                 <span class="comment">// This bullet contact had a TOI event</span>
<a name="l00170"></a>00170                 e_bulletHitFlag         = 0x0010,
<a name="l00171"></a>00171 
<a name="l00172"></a>00172                 <span class="comment">// This contact has a valid TOI in m_toi</span>
<a name="l00173"></a>00173                 e_toiFlag                       = 0x0020
<a name="l00174"></a>00174         };
<a name="l00175"></a>00175 
<a name="l00177"></a>00177         <span class="keywordtype">void</span> <a class="code" href="classb2_contact.html#a44a3d32149021269eb9dfd4015c98e0d" title="Flag this contact for filtering. Filtering will occur the next time step.">FlagForFiltering</a>();
<a name="l00178"></a>00178 
<a name="l00179"></a>00179         <span class="keyword">static</span> <span class="keywordtype">void</span> AddType(b2ContactCreateFcn* createFcn, b2ContactDestroyFcn* destroyFcn,
<a name="l00180"></a>00180                                                 b2Shape::Type typeA, b2Shape::Type typeB);
<a name="l00181"></a>00181         <span class="keyword">static</span> <span class="keywordtype">void</span> InitializeRegisters();
<a name="l00182"></a>00182         <span class="keyword">static</span> <a class="code" href="classb2_contact.html">b2Contact</a>* Create(<a class="code" href="classb2_fixture.html">b2Fixture</a>* fixtureA, int32 indexA, <a class="code" href="classb2_fixture.html">b2Fixture</a>* fixtureB, int32 indexB, <a class="code" href="classb2_block_allocator.html">b2BlockAllocator</a>* allocator);
<a name="l00183"></a>00183         <span class="keyword">static</span> <span class="keywordtype">void</span> Destroy(<a class="code" href="classb2_contact.html">b2Contact</a>* contact, b2Shape::Type typeA, b2Shape::Type typeB, <a class="code" href="classb2_block_allocator.html">b2BlockAllocator</a>* allocator);
<a name="l00184"></a>00184         <span class="keyword">static</span> <span class="keywordtype">void</span> Destroy(<a class="code" href="classb2_contact.html">b2Contact</a>* contact, <a class="code" href="classb2_block_allocator.html">b2BlockAllocator</a>* allocator);
<a name="l00185"></a>00185 
<a name="l00186"></a>00186         <a class="code" href="classb2_contact.html">b2Contact</a>() : m_fixtureA(NULL), m_fixtureB(NULL) {}
<a name="l00187"></a>00187         <a class="code" href="classb2_contact.html">b2Contact</a>(<a class="code" href="classb2_fixture.html">b2Fixture</a>* fixtureA, int32 indexA, <a class="code" href="classb2_fixture.html">b2Fixture</a>* fixtureB, int32 indexB);
<a name="l00188"></a>00188         <span class="keyword">virtual</span> ~<a class="code" href="classb2_contact.html">b2Contact</a>() {}
<a name="l00189"></a>00189 
<a name="l00190"></a>00190         <span class="keywordtype">void</span> Update(<a class="code" href="classb2_contact_listener.html">b2ContactListener</a>* listener);
<a name="l00191"></a>00191 
<a name="l00192"></a>00192         <span class="keyword">static</span> <a class="code" href="structb2_contact_register.html">b2ContactRegister</a> s_registers[b2Shape::e_typeCount][b2Shape::e_typeCount];
<a name="l00193"></a>00193         <span class="keyword">static</span> <span class="keywordtype">bool</span> s_initialized;
<a name="l00194"></a>00194 
<a name="l00195"></a>00195         uint32 m_flags;
<a name="l00196"></a>00196 
<a name="l00197"></a>00197         <span class="comment">// World pool and list pointers.</span>
<a name="l00198"></a>00198         <a class="code" href="classb2_contact.html">b2Contact</a>* m_prev;
<a name="l00199"></a>00199         <a class="code" href="classb2_contact.html">b2Contact</a>* m_next;
<a name="l00200"></a>00200 
<a name="l00201"></a>00201         <span class="comment">// Nodes for connecting bodies.</span>
<a name="l00202"></a>00202         <a class="code" href="structb2_contact_edge.html">b2ContactEdge</a> m_nodeA;
<a name="l00203"></a>00203         <a class="code" href="structb2_contact_edge.html">b2ContactEdge</a> m_nodeB;
<a name="l00204"></a>00204 
<a name="l00205"></a>00205         <a class="code" href="classb2_fixture.html">b2Fixture</a>* m_fixtureA;
<a name="l00206"></a>00206         <a class="code" href="classb2_fixture.html">b2Fixture</a>* m_fixtureB;
<a name="l00207"></a>00207 
<a name="l00208"></a>00208         int32 m_indexA;
<a name="l00209"></a>00209         int32 m_indexB;
<a name="l00210"></a>00210 
<a name="l00211"></a>00211         <a class="code" href="structb2_manifold.html">b2Manifold</a> m_manifold;
<a name="l00212"></a>00212 
<a name="l00213"></a>00213         int32 m_toiCount;
<a name="l00214"></a>00214         float32 m_toi;
<a name="l00215"></a>00215 
<a name="l00216"></a>00216         float32 m_friction;
<a name="l00217"></a>00217         float32 m_restitution;
<a name="l00218"></a>00218 
<a name="l00219"></a>00219         float32 m_tangentSpeed;
<a name="l00220"></a>00220 };
<a name="l00221"></a>00221 
<a name="l00222"></a><a class="code" href="classb2_contact.html#ab0597077b23615476327f9b32d9c4979">00222</a> <span class="keyword">inline</span> <a class="code" href="structb2_manifold.html">b2Manifold</a>* <a class="code" href="classb2_contact.html#ab0597077b23615476327f9b32d9c4979">b2Contact::GetManifold</a>()
<a name="l00223"></a>00223 {
<a name="l00224"></a>00224         <span class="keywordflow">return</span> &amp;m_manifold;
<a name="l00225"></a>00225 }
<a name="l00226"></a>00226 
<a name="l00227"></a>00227 <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="structb2_manifold.html">b2Manifold</a>* <a class="code" href="classb2_contact.html#ab0597077b23615476327f9b32d9c4979">b2Contact::GetManifold</a>()<span class="keyword"> const</span>
<a name="l00228"></a>00228 <span class="keyword"></span>{
<a name="l00229"></a>00229         <span class="keywordflow">return</span> &amp;m_manifold;
<a name="l00230"></a>00230 }
<a name="l00231"></a>00231 
<a name="l00232"></a><a class="code" href="classb2_contact.html#a6a30a44a28b44754cb61bba65cb5b728">00232</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_contact.html#a6a30a44a28b44754cb61bba65cb5b728" title="Get the world manifold.">b2Contact::GetWorldManifold</a>(<a class="code" href="structb2_world_manifold.html" title="This is used to compute the current state of a contact manifold.">b2WorldManifold</a>* worldManifold)<span class="keyword"> const</span>
<a name="l00233"></a>00233 <span class="keyword"></span>{
<a name="l00234"></a>00234         <span class="keyword">const</span> <a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>* bodyA = m_fixtureA-&gt;<a class="code" href="classb2_fixture.html#a9d6536ef274d768e86ab0a8330921535">GetBody</a>();
<a name="l00235"></a>00235         <span class="keyword">const</span> <a class="code" href="classb2_body.html" title="A rigid body. These are created via b2World::CreateBody.">b2Body</a>* bodyB = m_fixtureB-&gt;<a class="code" href="classb2_fixture.html#a9d6536ef274d768e86ab0a8330921535">GetBody</a>();
<a name="l00236"></a>00236         <span class="keyword">const</span> <a class="code" href="classb2_shape.html">b2Shape</a>* shapeA = m_fixtureA-&gt;<a class="code" href="classb2_fixture.html#aaa2b73fa212fa53b1c800cccd7a1d31e">GetShape</a>();
<a name="l00237"></a>00237         <span class="keyword">const</span> <a class="code" href="classb2_shape.html">b2Shape</a>* shapeB = m_fixtureB-&gt;<a class="code" href="classb2_fixture.html#aaa2b73fa212fa53b1c800cccd7a1d31e">GetShape</a>();
<a name="l00238"></a>00238 
<a name="l00239"></a>00239         worldManifold-&gt;<a class="code" href="structb2_world_manifold.html#a896dd7e7d4d6f6a5bc69e19fbd6871bd">Initialize</a>(&amp;m_manifold, bodyA-&gt;<a class="code" href="classb2_body.html#adaaebca750d0bda56a543884adc5f519">GetTransform</a>(), shapeA-&gt;m_radius, bodyB-&gt;<a class="code" href="classb2_body.html#adaaebca750d0bda56a543884adc5f519">GetTransform</a>(), shapeB-&gt;m_radius);
<a name="l00240"></a>00240 }
<a name="l00241"></a>00241 
<a name="l00242"></a><a class="code" href="classb2_contact.html#a6edf582f8c161d6632854cddefe55a0c">00242</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_contact.html#a6edf582f8c161d6632854cddefe55a0c">b2Contact::SetEnabled</a>(<span class="keywordtype">bool</span> flag)
<a name="l00243"></a>00243 {
<a name="l00244"></a>00244         <span class="keywordflow">if</span> (flag)
<a name="l00245"></a>00245         {
<a name="l00246"></a>00246                 m_flags |= e_enabledFlag;
<a name="l00247"></a>00247         }
<a name="l00248"></a>00248         <span class="keywordflow">else</span>
<a name="l00249"></a>00249         {
<a name="l00250"></a>00250                 m_flags &amp;= ~e_enabledFlag;
<a name="l00251"></a>00251         }
<a name="l00252"></a>00252 }
<a name="l00253"></a>00253 
<a name="l00254"></a><a class="code" href="classb2_contact.html#ae7bd71ee1b0bb352bec6eeaab4f91c6a">00254</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classb2_contact.html#ae7bd71ee1b0bb352bec6eeaab4f91c6a" title="Has this contact been disabled?">b2Contact::IsEnabled</a>()<span class="keyword"> const</span>
<a name="l00255"></a>00255 <span class="keyword"></span>{
<a name="l00256"></a>00256         <span class="keywordflow">return</span> (m_flags &amp; e_enabledFlag) == e_enabledFlag;
<a name="l00257"></a>00257 }
<a name="l00258"></a>00258 
<a name="l00259"></a><a class="code" href="classb2_contact.html#a367dc9a563ad7db5547f4247777a33c9">00259</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classb2_contact.html#a367dc9a563ad7db5547f4247777a33c9" title="Is this contact touching?">b2Contact::IsTouching</a>()<span class="keyword"> const</span>
<a name="l00260"></a>00260 <span class="keyword"></span>{
<a name="l00261"></a>00261         <span class="keywordflow">return</span> (m_flags &amp; e_touchingFlag) == e_touchingFlag;
<a name="l00262"></a>00262 }
<a name="l00263"></a>00263 
<a name="l00264"></a><a class="code" href="classb2_contact.html#aebfebb1e4b27dc0bd7aa120093e3d650">00264</a> <span class="keyword">inline</span> <a class="code" href="classb2_contact.html">b2Contact</a>* <a class="code" href="classb2_contact.html#aebfebb1e4b27dc0bd7aa120093e3d650" title="Get the next contact in the world&#39;s contact list.">b2Contact::GetNext</a>()
<a name="l00265"></a>00265 {
<a name="l00266"></a>00266         <span class="keywordflow">return</span> m_next;
<a name="l00267"></a>00267 }
<a name="l00268"></a>00268 
<a name="l00269"></a>00269 <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classb2_contact.html">b2Contact</a>* <a class="code" href="classb2_contact.html#aebfebb1e4b27dc0bd7aa120093e3d650" title="Get the next contact in the world&#39;s contact list.">b2Contact::GetNext</a>()<span class="keyword"> const</span>
<a name="l00270"></a>00270 <span class="keyword"></span>{
<a name="l00271"></a>00271         <span class="keywordflow">return</span> m_next;
<a name="l00272"></a>00272 }
<a name="l00273"></a>00273 
<a name="l00274"></a><a class="code" href="classb2_contact.html#a707a3a5a14c2cdd4c6eb7fc648d76037">00274</a> <span class="keyword">inline</span> <a class="code" href="classb2_fixture.html">b2Fixture</a>* <a class="code" href="classb2_contact.html#a707a3a5a14c2cdd4c6eb7fc648d76037" title="Get fixture A in this contact.">b2Contact::GetFixtureA</a>()
<a name="l00275"></a>00275 {
<a name="l00276"></a>00276         <span class="keywordflow">return</span> m_fixtureA;
<a name="l00277"></a>00277 }
<a name="l00278"></a>00278 
<a name="l00279"></a>00279 <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classb2_fixture.html">b2Fixture</a>* <a class="code" href="classb2_contact.html#a707a3a5a14c2cdd4c6eb7fc648d76037" title="Get fixture A in this contact.">b2Contact::GetFixtureA</a>()<span class="keyword"> const</span>
<a name="l00280"></a>00280 <span class="keyword"></span>{
<a name="l00281"></a>00281         <span class="keywordflow">return</span> m_fixtureA;
<a name="l00282"></a>00282 }
<a name="l00283"></a>00283 
<a name="l00284"></a><a class="code" href="classb2_contact.html#a68464fe587d7e6a1f52763e965bb7361">00284</a> <span class="keyword">inline</span> <a class="code" href="classb2_fixture.html">b2Fixture</a>* <a class="code" href="classb2_contact.html#a68464fe587d7e6a1f52763e965bb7361" title="Get fixture B in this contact.">b2Contact::GetFixtureB</a>()
<a name="l00285"></a>00285 {
<a name="l00286"></a>00286         <span class="keywordflow">return</span> m_fixtureB;
<a name="l00287"></a>00287 }
<a name="l00288"></a>00288 
<a name="l00289"></a><a class="code" href="classb2_contact.html#ab0c9c059c776f315ae62abb5c978afcc">00289</a> <span class="keyword">inline</span> int32 <a class="code" href="classb2_contact.html#ab0c9c059c776f315ae62abb5c978afcc" title="Get the child primitive index for fixture A.">b2Contact::GetChildIndexA</a>()<span class="keyword"> const</span>
<a name="l00290"></a>00290 <span class="keyword"></span>{
<a name="l00291"></a>00291         <span class="keywordflow">return</span> m_indexA;
<a name="l00292"></a>00292 }
<a name="l00293"></a>00293 
<a name="l00294"></a>00294 <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classb2_fixture.html">b2Fixture</a>* <a class="code" href="classb2_contact.html#a68464fe587d7e6a1f52763e965bb7361" title="Get fixture B in this contact.">b2Contact::GetFixtureB</a>()<span class="keyword"> const</span>
<a name="l00295"></a>00295 <span class="keyword"></span>{
<a name="l00296"></a>00296         <span class="keywordflow">return</span> m_fixtureB;
<a name="l00297"></a>00297 }
<a name="l00298"></a>00298 
<a name="l00299"></a><a class="code" href="classb2_contact.html#a9edc26022c3d1a9cf1dab9d79d639b3f">00299</a> <span class="keyword">inline</span> int32 <a class="code" href="classb2_contact.html#a9edc26022c3d1a9cf1dab9d79d639b3f" title="Get the child primitive index for fixture B.">b2Contact::GetChildIndexB</a>()<span class="keyword"> const</span>
<a name="l00300"></a>00300 <span class="keyword"></span>{
<a name="l00301"></a>00301         <span class="keywordflow">return</span> m_indexB;
<a name="l00302"></a>00302 }
<a name="l00303"></a>00303 
<a name="l00304"></a><a class="code" href="classb2_contact.html#a44a3d32149021269eb9dfd4015c98e0d">00304</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_contact.html#a44a3d32149021269eb9dfd4015c98e0d" title="Flag this contact for filtering. Filtering will occur the next time step.">b2Contact::FlagForFiltering</a>()
<a name="l00305"></a>00305 {
<a name="l00306"></a>00306         m_flags |= e_filterFlag;
<a name="l00307"></a>00307 }
<a name="l00308"></a>00308 
<a name="l00309"></a><a class="code" href="classb2_contact.html#a5e8fbb6bb2966ac84272bb0ea9d2e4c7">00309</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_contact.html#a5e8fbb6bb2966ac84272bb0ea9d2e4c7">b2Contact::SetFriction</a>(float32 friction)
<a name="l00310"></a>00310 {
<a name="l00311"></a>00311         m_friction = friction;
<a name="l00312"></a>00312 }
<a name="l00313"></a>00313 
<a name="l00314"></a><a class="code" href="classb2_contact.html#a0b6daf4137fd1719961f5d780b8dda15">00314</a> <span class="keyword">inline</span> float32 <a class="code" href="classb2_contact.html#a0b6daf4137fd1719961f5d780b8dda15" title="Get the friction.">b2Contact::GetFriction</a>()<span class="keyword"> const</span>
<a name="l00315"></a>00315 <span class="keyword"></span>{
<a name="l00316"></a>00316         <span class="keywordflow">return</span> m_friction;
<a name="l00317"></a>00317 }
<a name="l00318"></a>00318 
<a name="l00319"></a><a class="code" href="classb2_contact.html#ad66d9290da187cef4c9f48c5766d4460">00319</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_contact.html#ad66d9290da187cef4c9f48c5766d4460" title="Reset the friction mixture to the default value.">b2Contact::ResetFriction</a>()
<a name="l00320"></a>00320 {
<a name="l00321"></a>00321         m_friction = b2MixFriction(m_fixtureA-&gt;m_friction, m_fixtureB-&gt;m_friction);
<a name="l00322"></a>00322 }
<a name="l00323"></a>00323 
<a name="l00324"></a><a class="code" href="classb2_contact.html#a24ca342c2bb766c53ef5ad04f5268fc1">00324</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_contact.html#a24ca342c2bb766c53ef5ad04f5268fc1">b2Contact::SetRestitution</a>(float32 restitution)
<a name="l00325"></a>00325 {
<a name="l00326"></a>00326         m_restitution = restitution;
<a name="l00327"></a>00327 }
<a name="l00328"></a>00328 
<a name="l00329"></a><a class="code" href="classb2_contact.html#aed12746a2855277479802144b699326b">00329</a> <span class="keyword">inline</span> float32 <a class="code" href="classb2_contact.html#aed12746a2855277479802144b699326b" title="Get the restitution.">b2Contact::GetRestitution</a>()<span class="keyword"> const</span>
<a name="l00330"></a>00330 <span class="keyword"></span>{
<a name="l00331"></a>00331         <span class="keywordflow">return</span> m_restitution;
<a name="l00332"></a>00332 }
<a name="l00333"></a>00333 
<a name="l00334"></a><a class="code" href="classb2_contact.html#a243501bc5c146e9eb1296162d328aef1">00334</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_contact.html#a243501bc5c146e9eb1296162d328aef1" title="Reset the restitution to the default value.">b2Contact::ResetRestitution</a>()
<a name="l00335"></a>00335 {
<a name="l00336"></a>00336         m_restitution = b2MixRestitution(m_fixtureA-&gt;m_restitution, m_fixtureB-&gt;m_restitution);
<a name="l00337"></a>00337 }
<a name="l00338"></a>00338 
<a name="l00339"></a><a class="code" href="classb2_contact.html#a32033914a6c7f35b469e8fddbc17c566">00339</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classb2_contact.html#a32033914a6c7f35b469e8fddbc17c566" title="Set the desired tangent speed for a conveyor belt behavior. In meters per second.">b2Contact::SetTangentSpeed</a>(float32 speed)
<a name="l00340"></a>00340 {
<a name="l00341"></a>00341         m_tangentSpeed = speed;
<a name="l00342"></a>00342 }
<a name="l00343"></a>00343 
<a name="l00344"></a><a class="code" href="classb2_contact.html#a961417ed0d43706ee8a39c396d5e6002">00344</a> <span class="keyword">inline</span> float32 <a class="code" href="classb2_contact.html#a961417ed0d43706ee8a39c396d5e6002" title="Get the desired tangent speed. In meters per second.">b2Contact::GetTangentSpeed</a>()<span class="keyword"> const</span>
<a name="l00345"></a>00345 <span class="keyword"></span>{
<a name="l00346"></a>00346         <span class="keywordflow">return</span> m_tangentSpeed;
<a name="l00347"></a>00347 }
<a name="l00348"></a>00348 
<a name="l00349"></a>00349 <span class="preprocessor">#endif</span>
</pre></div></div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><b>b2Contact.h</b>      </li>

    <li class="footer">Generated on Mon Sep 17 2012 15:56:57 for Box2D APi by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.0 </li>
   </ul>
 </div>


</body>
</html>
